package com.china.produce.message;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.StringRedisTemplate;

/**
 * @ClassName
 * @Author niujie
 * @Version
 * @Description
 * @CreateTime 2025/6/24
 */
@Configuration
public class MessageDistributorAutoConfiguration {

    @Bean("messageDistributor")
    @ConditionalOnMissingBean(MessageDistributor.class)
    public RedisMessageDistributor messageDistributor(StringRedisTemplate redisTemplate) {
        return new RedisMessageDistributor(redisTemplate);
    }
}
